package provaThread;

public class MyThread extends Thread {
    int n;
    MyThread (int n){
        this.n = n;
    }

    @Override
    public void run() {
        int i = 0;
        while (i < 2) {
            for (int j =0; j<n;j++){
                System.out.print("    ");
            }
            System.out.println("I Am The Worker Thread "+n);
            i++;
            try {
                sleep(100);
            } catch (Exception ex) {
                System.out.println("Error. " + ex);
                return;
            }
        }
    }
}
